<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>Job</title>
    <script type="text/javascript">
        function cityQuery(cityId) {
            location.href = "search.do?cityId=" + cityId;
        }
        function condQuery(name, code) {
            location.href = "search.do?" + name + "=" + code;
        }
        $(function () {
            $("#searchBtn").click(function (e) {
                location.href = "search.do";
            });
        });
    </script>
</head>
<body>
<!--搜索框-->
<div class="container cymgtop80">
    <div class="row">
        <form class="form col-md-9" role="search">
            <div class="form-group col-md-10">
                <div class="position11 col-md-2">
                    <select class="form-control position10 width105 height46 border_radiu_rightno">
                        <option>职位名</option>
                        <option>公司名</option>
                        <option>全职</option>
                    </select>
                </div>

                <input type="text" class="form-control border_radiu_rightno height48 text_indent"
                       placeholder="输入职位关键词：如 销售总监等">

            </div>
            <button id="searchBtn" type="button"
                    class="btn btn-primary col-md-2 border_radiu_leftno font_size22 cymgleft-15 height48">搜索
            </button>
        </form>
        <p class="new-post col-md-3 ">
            本周新增职位&nbsp;&nbsp;<span>1</span><span>1</span><span>5</span><span>5</span><span>5</span>&nbsp;&nbsp;个</p>
    </div>
</div>
<!--搜索结果-->
<div class="container cymgtop20">
    <div class="row">
        <div class="dropdown col-md-2" style="padding:50px 0;">
            <dl class="selected" id="Collection" style="display:;">
                <dt>已经选择</dt>
                <dd id="Collections"> 2k-5k</dd>
                <dd id="Collections">应届毕业生</dd>
                <dd id="Collections">硕士</dd>
            </dl>
            <c:forEach items="${positionEnums}" var="positionEnum">
                <div class="btn-group btn-group-justified">
                    <div class="btn-group bdradius cymgtop20">
                        <button type="button" class="btn btn-default" id="dropdownMenu1" data-toggle="dropdown">
                                ${positionEnum.name}
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" id="lbfb" role="menu" aria-labelledby="dropdownMenu1">
                            <c:forEach items="${positionEnum.enums}" var="penum">
                                <li role="presentation">
                                    <c:choose>
                                        <c:when test="${empty penum.childs}">
                                            <a role="menuitem" tabindex="-1" href="#"
                                               onclick="condQuery('${penum.name}', '${penum.code}');">${penum.value}</a>
                                        </c:when>
                                        <c:otherwise>
                                            <a tabindex="-1" href="javascript:;">${penum.value}</a>
                                            <ul class="dropdown-menu" role="menu" id="lbfb" style="top:5px;left:101%;">
                                                <c:forEach items="${penum.childs}" var="child">
                                                    <li><a tabindex="-1" href="javascript:;"
                                                           onclick="condQuery('${child.name}', '${child.code}');">${child.value}</a>
                                                    </li>
                                                </c:forEach>
                                            </ul>
                                        </c:otherwise>
                                    </c:choose>
                                </li>
                            </c:forEach>
                        </ul>
                    </div>
                </div>
            </c:forEach>
        </div>
        <div class="col-md-10">
            <ul id="mytab4" class="nav nav-pills nav-justified" role="tablist">
                <li role="presentation"><a href="#">工作地点</a></li>
                <c:forEach items="${topCitys}" var="topCity">
                    <li role="presentation"><a href="#" onclick="cityQuery(${topCity.id});">${topCity.cityName}</a></li>
                </c:forEach>
                <li role="presentation" class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">其它：<span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <c:forEach items="${nontopCityMap}" var="nontopCity">
                            <li role="presentation">
                                <dl>
                                    <dt>${nontopCity.key}</dt>
                                    <dd>
                                        <c:forEach items="${nontopCity.value}" var="city">
                                            <a href="#" onclick="cityQuery(${city.id})">${city.cityName}</a>
                                        </c:forEach>
                                    </dd>
                                </dl>
                            </li>
                        </c:forEach>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="col-md-10 cymgtop20">
            <ul id="sosolistjob" class="list-unstyled bggray pd10">
                <c:forEach items="${pageConfig.items}" var="position">
                    <li>
                        <div class="hot_pos_l">
                            <div class="mb10">
                                <a href="#" title="PHP" target="_blank"><span>${position.positionName}</span></a>
                                &nbsp;
                                <span class="c9">[${position.cityName}]</span>
                            </div>
                            <span><em class="c7">职位月薪：</em>${position.salaryLow}-${position.salaryHight}</span>&nbsp;&nbsp;&nbsp;
                            <span><em class="c7">工作经验：</em>${position.workingLife.msg}</span>&nbsp;&nbsp;&nbsp;
                            <span><em class="c7">学历要求： </em>${position.educationRequirements.msg}</span>

                            <div>
                                <span><em class="c7">公司名称： </em>${position.companyName}</span>&nbsp;&nbsp;&nbsp;
                                <span><em class="c7">公司得分： </em>${position.companyScore}</span>
                            </div>
                        </div>
                    </li>
                </c:forEach>
            </ul>
            <ul class="pagination">
                <li class="disabled"><a href="#">&laquo;</a></li>
                <li class="active"><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li><a href="#">&raquo;</a></li>
            </ul>
        </div>

    </div>
</div>
<script>
    $("#navs a").click(function (e) {
        e.preventDefault();
        $(this).tab("show");
    })
</script>
</body>
</html>